package org.css.mobile.system.dao.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.css.mobile.system.dao.CcsUserDetailInfoDao;
import org.css.mobile.system.domain.CcsUserDetailInfo;
import org.css.mobile.system.mapper.CcsUserDetailInfoMapper;
import org.springframework.stereotype.Repository;

@Repository
public class CcsUserDetailInfoDaoImpl extends ServiceImpl<CcsUserDetailInfoMapper, CcsUserDetailInfo> implements CcsUserDetailInfoDao {
    @Override
    public CcsUserDetailInfo selectByUserId(Long userId) {
        return lambdaQuery()
                .eq(CcsUserDetailInfo::getUserId, userId)
                .one();
    }

    @Override
    public boolean updateByUserId(CcsUserDetailInfo ccsUserDetailInfo) {
         return lambdaUpdate()
                .eq(CcsUserDetailInfo::getUserId, ccsUserDetailInfo.getUserId())
                .set(CcsUserDetailInfo::getAge, ccsUserDetailInfo.getAge())
                .set(CcsUserDetailInfo::getIdentification, ccsUserDetailInfo.getIdentification())
                .set(CcsUserDetailInfo::getIdentificationType, ccsUserDetailInfo.getIdentificationType())
                .update();
    }

}
